home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 6 code / TCP / NewsWatcher / NW Source / Source / open.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-05  |  1.0 KB  |  43 lines  |  [TEXT/MMCC]

  1. /*----------------------------------------------------------------------------
  2.  
  3.     open.c
  4.  
  5.     This module handles the "Open" command. 
  6.     
  7.     Copyright © 1994-1995, Northwestern University.
  8.  
  9. ----------------------------------------------------------------------------*/
  10.  
  11. #include "glob.h"
  12. #include "open.h"
  13. #include "sfutil.h"
  14. #include "newsrc.h"
  15. #include "message.h"
  16. #include "fileutil.h"
  17.  
  18.  
  19.  
  20. /*----------------------------------------------------------------------------
  21.     DoOpen
  22.     
  23.     Handle the "Open" command.
  24.     
  25.     Exit:    function result = error code.
  26. ----------------------------------------------------------------------------*/
  27.  
  28. OSErr DoOpen (void)
  29. {
  30.     StandardFileReply reply;
  31.     WindowPtr wind;
  32.     
  33.     MyStandardGetFile(nil, kNumOpenTypeList, kOpenTypeList, &reply, 
  34.         gPrefs.savedUGLDefaultFolder ? gPrefs.savedUGLDefaultFolderAlias : nil);
  35.     if (!reply.sfGood) {
  36.         return userCanceledErr;
  37.     } else if (reply.sfType == kSavedUserGroupListFileType) {
  38.         return OpenUserGroupListFile(&reply.sfFile);
  39.     } else {
  40.         return OpenMessageFile(&reply.sfFile, &wind);
  41.     }
  42. }
  43.